package cn.springBoot.dao;

import cn.springBoot.entity.User;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;


import com.baomidou.mybatisplus.mapper.BaseMapper;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author ljx
 * @since 2020-01-16
 */

public interface UserDao extends BaseMapper<User> {

	  
	    /**     
	     * @discription 在此输入一句话描述作用
	     * @author ljx       
	     * @created 2020年10月12日 下午3:31:15     
	     * @param id
	     * @return     
	     */
	 @Select("select * from user where id = #{id}")
	 User selectByIda(int id);

		/**
		 * @param user
		 */
	 @Update("UPDATE user SET name=#{name} WHERE id=#{id}")
     void updateUser(User user);
 
	 @Delete("DELETE FROM user WHERE id=#{id}")
	 public void deleteUserById(Integer id);

	 @Insert("INSERT INTO user(name) VALUES(#{name}")
	 public void insertUser(User employee);

	 @Select("SELECT * FROM user WHERE name = #{name}")
	 User getUserByLastName(String lastName);

}
